<?php
/**
 * 格式验证类
 *
 * @author 高文杰 <gaowenjie_xy@126.com>
 */
class Validation
{
    /**
     * 验证邮箱的格式
     */
    static public function isEmailAddress($emailAddress)
    {
        if (empty($emailAddress))
            return false;

        $emailAddress = strtolower($emailAddress);

        if (preg_match("/^[a-z0-9-]+(\.[a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/", $emailAddress)) {
            return true;
        } else {
            return false;
        }
    }
}
?>